package com.manthano.security.context;

import java.util.Date;

import javax.servlet.http.HttpSession;

/**
 * @author LXMRX
 */
public class UserSession
{
	private HttpSession	session	= null;

	protected UserSession(HttpSession httpSession)
	{
		session = httpSession;
	}

	/**
	 * @return Date Session CreationcTime
	 */
	public Date getCreationTime()
	{
		return new Date(session.getCreationTime());
	}

	/**
	 * @return Date Session LastAccessedTime
	 */
	public Date getLastAccessedTime()
	{
		return new Date(session.getLastAccessedTime());
	}

	/**
	 * @return Date SessionExpireTime
	 */
	public Date getSessionExpireTime()
	{
		return new Date(System.currentTimeMillis() + session.getMaxInactiveInterval() * 1000);
	}
}
